package ni;


import org.json.JSONException;
import org.json.JSONObject;


public class Message extends JSONObject{

	public Message() {
        super();
    }

    public Message(String data) throws JSONException {
        super(data);
    }

    public String getMessageData() {
        String returnValue = " ";
        try {
            returnValue = (String) this.get("messageData");
        } catch (JSONException ex) {
            System.err.println("Message : Can't get messageData value");
        }
        return returnValue;
    }

    public String getUserName() {
        String returnValue = " ";
        try {
            returnValue = (String) this.get("userName");
        } catch (JSONException ex) {
            System.err.println("Message : Can't get userName value");
        }
        return returnValue;
    }

    public String getType() {
        String returnValue = " ";
        try {
            returnValue = (String) this.get("type");
        } catch (JSONException ex) {
            System.err.println("Message : Can't get type value");
        }
        return returnValue;
    }

    public int getMessageNumber() {
        int returnValue = -2;
        try {
            returnValue = this.getInt("messageNumber") ;
        } catch (JSONException ex) {
            System.err.println("Message : Can't get messageNumber value");
        }
        return returnValue;
    }
	
}
